`timescale 1ns / 1ps
 
module EXT16T32 (X, Select, Y);
 
    //要移位的信号x 选择是0扩展还是符号扩展的select
 
    input [15:0] X;
 
    input Select;
 
    output [31:0] Y;
 
   
 
    wire [31:0] E0, E1;//e0是零扩展 e1是符号扩展
 
    wire [15:0] e = {16{X[15]}};//e是x[15]的符号位*16
 
   
 
    parameter z = 16'b0;//用于0扩展
   
    assign E0 = {z, X};
    assign E1 = {e, X};
   
    MUX2X32 select_for_ext16t32(E0, E1, Select, Y);//e0是零扩展 e1是符号扩展
   
endmodule